home *** CD-ROM | disk | FTP | other *** search
- Path: scel.sequent.com!news
- From: Richard Shields <richards@sequent.com>
- Newsgroups: comp.lang.c++
- Subject: Templates, Microsoft and Borland
- Date: Fri, 22 Mar 1996 10:52:47 -0800
- Organization: Sequent Computer Systems Inc.
- Message-ID: <3152F6FF.AFC@sequent.com>
- NNTP-Posting-Host: w-richards.cha.sequent.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- I tried this very simple code in both Microsoft 4.0 and Borland 4.52:
-
- template <class T>
- class TMatrix
- {
- public:
- private:
- };
-
- template <class T>
- TMatrix<T>
- operator *(TMatrix<T> *m1, TMatrix<T> *m2);
-
-
- I left out all the class data members and member functions for clarity.
-
- When I compile these few statements in VC++ 4.0 I get this error:
-
- error C2803: 'operator *' must have at least one formal parameter of
- class type.
-
- When I compile the code under Borland 4.52 I get no errors. So, who is
- more correct. Is VC++ not supporting perfectly acceptable syntax or is
- Borland supporting something out of the ordinary? Personally, I see
- nothing wrong with the code.
-
- Thanks,
- Rich
-